home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 22 / Amiga Format AFCD22 (Jan 1998, Issue 106).iso / -seriously_amiga- / shareware / programming / other / gui4cli / tools / rtn / filepop < prev    next >
Text File  |  1997-11-17  |  3KB  |  147 lines

  1. G4C
  2.  
  3. ; Opens pop-up window to deal with a file
  4.  
  5. ; USE:
  6. ; GuiLoad guis:tools/rtn/FilePop FileName    -or
  7. ; GuiOpen FilePop FileName
  8.  
  9. ; ================================================================
  10.  
  11. ;             Globals & system events
  12.  
  13. ; ================================================================
  14.  
  15. WinBig 0 0 80 90 ""
  16. WinType 00001000
  17. winonmouse 30 7 
  18.  
  19. xonload filename
  20. if $filename > ''
  21.    guiopen FilePop $filename
  22. endif
  23.  
  24. xonreload filename
  25. if $filename > ''
  26.    guiopen FilePop $filename
  27. endif
  28.  
  29. xonopen filename  ; just to get the var
  30.  
  31. xOnRMB 
  32. guiclose FilePop
  33.  
  34. xOnInactive
  35. guiclose FilePop
  36.  
  37. xOnFail
  38. ezreq "Error during operation" OK ""
  39.  
  40. xOnQuit
  41. guiquit FilePop2
  42.  
  43. ; ================================================================
  44.  
  45. ;             Buttons
  46.  
  47. ; ================================================================
  48.  
  49. xbutton 0 0 0 15 Auto
  50. guiclose FilePop
  51. guiload guis:tools/rtn/GetFileType $filepop/filename
  52. filetype = $$ret.0
  53. if $filetype > ''
  54.    guiload guis:tools/rtn/ViewFile $FilePop/filename $FilePop/filetype RUN
  55. endif
  56.  
  57. xbutton 0 15 0 15 More..
  58. guiopen  FilePop2
  59. guiclose FilePop
  60.  
  61. xbutton 0 30 0 15 List
  62. guiload guis:tools/read.gc $FilePop/filename
  63.  
  64. xbutton 0 45 0 15 Cli..
  65. guiclose FilePop
  66. guiload guis:tools/cli.gc $filepop/filename CLI
  67.  
  68. xbutton 0 60 0 15 'Edit'
  69. ifexists port rexx_ced        ; if the CygnusEd editor is running..
  70.    ifexists gui cedbar.gc    ; use it for the editing
  71.        guiscreen cedbar.gc front
  72.    else
  73.        guiscreen FilePop back    ; hoping that Ced is the next screen..
  74.    endif
  75.    sendrexx rexx_ced 'open new'
  76.    sendrexx rexx_ced 'open $filename'
  77.    sendrexx rexx_ced 'expand view'
  78. elseifexists variable *DEF.EDITOR
  79.    run '$*DEF.EDITOR $filename'
  80. else
  81.    run 'c:ed $filename'
  82. endif
  83. guiclose FilePop
  84.  
  85.  
  86. xbutton 0 75 0 15 Rx
  87. guiclose FilePop
  88. cli 'rx $filename'
  89.  
  90.  
  91. ;######################################################################
  92.  
  93.     NEWFILE FilePop2    ; Pop-up on double-click "More.." gui.
  94.                 ; edit this gui to fit your favourites
  95.  
  96. ;######################################################################
  97.  
  98. WinBig 0 0 80 90 ""
  99. WinType 00001000
  100. winonmouse 30 7 
  101. varpath 'FilePop'
  102.  
  103. xOnRMB 
  104. guiclose FilePop2
  105.  
  106. xOnInactive
  107. guiclose FilePop2
  108.  
  109. xOnFail
  110. ezreq "Error during operation" OK ""
  111.  
  112. ;---------------> the Buttons
  113.  
  114. xbutton 0 0 0 15 FRead
  115. guiclose FilePop2
  116. *FRGUIDE = $filename
  117. guiload guis:tools/fastread/fread.gc
  118.  
  119. xbutton 0 15 0 15 DPaint
  120. guiclose FilePop2
  121. ifexists variable *DEF.PAINT
  122. and $*DEF.PAINT > ' '
  123.     run 'wbrun $*DEF.PAINT $filename'
  124. else
  125.     GuiLoad guis:tools/rtn/FindFile "DPaintV"
  126.     progname = $$ret.0
  127.     if $progname > ''
  128.         run '$progname $filename'
  129.     endif
  130. endif
  131.  
  132. xbutton 0 30 0 15 'HexView'
  133. ifexists variable *DEF.HEX
  134.     run '$*DEF.HEX $filename'
  135. else
  136.     cli 'c:type >ram:txt $filename HEX'
  137.     guiload guis:tools/read.gc ram:txt
  138. endif
  139.  
  140. xbutton 0 45 0 15 ''
  141.  
  142. xbutton 0 60 0 15 ''
  143.  
  144. xbutton 0 75 0 15 ''
  145.  
  146.  
  147.